import Vue from 'vue';
import App from './App';
import router from './router';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';    // 默认主题
import '../static/css/icon.css';
import "babel-polyfill";
import $ from 'jquery'; // Jquery
// import utils from '../src/components/common/getUrl'; // 获取URl参数js
// import axios from 'axios';
import ht from '../src/components/common/address'
import get from '../src/components/common/getUrl'
import resource from 'vue-resource'

Vue.use(ElementUI, { size: 'small' });
Vue.use(resource);

// Vue.prototype.$http = axios;
// Vue.prototype.$http = resource;


//使用钩子函数对路由进行权限跳转
// router.beforeEach((to, from, next , ) => {
    // localStorage.setItem('token',get.getUrlKey('sessionid'));
    // const role = sessionStorage.getItem('token');
    // // 判断token不存在跳回登录页
    // if(!role && to.path !== '/login'){
    //     next('/login');
    // }
    // else if (role && to.path ==='/login'){
    //     next('/');
    // }
    // else {
    //         next();
    //     }
    // });

new Vue({
    router,
    render: h => h(App)
}).$mount('#app');
